package com.hui.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hui.mapper.SystemConfigMapper;
import com.hui.entity.dao.SystemConfig;
import com.hui.service.SystemConfigService;
import org.springframework.stereotype.Service;

/**
 * 配置表(SystemConfig)表服务实现类
 *
 * @author hui
 * @since 2022-07-21 23:20:22
 */
@Service("systemConfigService")
public class SystemConfigServiceImpl extends ServiceImpl<SystemConfigMapper, SystemConfig> implements SystemConfigService {

    @Override
    public String getData(String name) {
        LambdaQueryWrapper<SystemConfig> wrapper = new LambdaQueryWrapper();
        wrapper.eq(SystemConfig::getMenuName, name);
        SystemConfig systemConfig = getOne(wrapper);
        return systemConfig == null ? "" : systemConfig.getValue();
    }
}

